<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改运费模板')"/>
    <th:block th:include="include :: bootstrap-fileinput-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-logistics-way-edit" th:object="${logisticsWay}">
        <input name="id" type="hidden" th:field="*{id}"/>
        <div class="form-group">
            <label class="col-sm-3 control-label"><span style="color: red; ">*</span>配送方式名称：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" th:field="*{wayName}" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label"><span style="color: red; ">*</span>关联配送模板：</label>
            <div class="col-sm-8">
                <select name="templateId" class="form-control m-b" th:with="template=${templateList}">
                    <option th:each="one : ${template}" th:text="${one.templateName}" th:value="${one.id}"
                            th:field="*{templateId}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label"><span style="color: red; ">*</span>是否默认：</label>
            <div class="col-sm-8">
                <div class="radio-box" th:each="dict : ${@dict.getType('is_enable')}">
                    <input type="radio" name="isDefault" th:id="${dict.dictCode}" th:value="${dict.dictValue}" th:field="*{isDefault}">
                    <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label"><span style="color: red; ">*</span>排序：</label>
            <div class="col-sm-4">
                <input class="form-control" type="number" name="orderNum" th:field="*{orderNum}" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">备注：</label>
            <div class="col-sm-8">
                <textarea class="form-control" type="text" name="remark" th:text="*{remark}"></textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label"><span style="color: red; ">*</span>状态：</label>
            <div class="col-sm-8">
                <div class="radio-box" th:each="dict : ${@dict.getType('show_status')}">
                    <input type="radio" th:id="${dict.dictCode}" name="isEnable" th:value="${dict.dictValue}" th:field="*{isEnable}">
                    <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
                </div>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: bootstrap-fileinput-js"/>

<script type="text/javascript">
    var prefix = ctx + "back/logisticsWay";

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-logistics-way-edit').serialize());
        }
    }
</script>
</body>
</html>
